package history;

public class History
{
  private int head;
  private int tail;
  private String[] array;
  
  public History(int n)
  {
    head = 0;
    tail = 0;
    array = new String[n];
  }
  
  public void addZeile(String zeile)
  {
    array[tail] = zeile;
    tail = (tail+1)%array.length;
    if(head+1 == tail && array[tail] != null)
      head++;
  }
  
  public void print()
  {
    for(int i = head; i<array.length; i++)
      System.out.println(array[i]);
    for(int i = 0; i<tail; i++)
      System.out.println(array[i]);
  }
}
